/* =========================================================
   PÁGINA DE NOTÍCIAS
   ========================================================= */

/* ---- Hero ---- */
.news-hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.news-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 80% 20%, rgba(201, 169, 97, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.news-hero__content {
  position: relative;
  max-width: 700px;
}

.news-hero__kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 1rem;
}

.news-hero__title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: -1px;
  line-height: 1.1;
}

.news-hero__title em {
  color: var(--secondary);
  font-style: italic;
}

.news-hero__text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* ---- Toolbar ---- */
.news-archive {
  padding: 3.5rem 0 5rem;
  background: var(--light);
}

.news-archive__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  background: var(--white);
  padding: 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(10, 37, 64, 0.06);
  box-shadow: 0 4px 20px rgba(10, 37, 64, 0.04);
}

.news-archive__search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 250px;
  padding: 0.75rem 1rem;
  background: var(--light);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.news-archive__search:focus-within {
  border-color: var(--secondary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.15);
}

.news-archive__search svg {
  width: 18px;
  height: 18px;
  color: var(--gray);
  flex-shrink: 0;
}

.news-archive__search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.92rem;
  color: var(--dark);
  outline: none;
  font-family: inherit;
}

.news-archive__filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.news-filter {
  padding: 0.55rem 1.1rem;
  background: transparent;
  border: 1px solid rgba(10, 37, 64, 0.12);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.news-filter:hover {
  border-color: var(--secondary);
  color: var(--primary);
}

.news-filter.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* ---- Layout ---- */
.news-archive__layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}

/* ---- Notícia em Destaque ---- */
.news-archive-featured {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 2.5rem;
  border: 1px solid rgba(10, 37, 64, 0.06);
  box-shadow: 0 10px 40px rgba(10, 37, 64, 0.06);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.news-archive-featured:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 60px rgba(10, 37, 64, 0.12);
}

.news-archive-featured__media {
  position: relative;
  margin: 0;
  height: 360px;
  overflow: hidden;
}

.news-archive-featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.news-archive-featured:hover .news-archive-featured__media img {
  transform: scale(1.05);
}

.news-archive-featured__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 37, 64, 0.6) 100%);
}

.news-category-badge {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  padding: 0.4rem 0.9rem;
  background: var(--secondary);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 100px;
  z-index: 2;
}

.news-category-badge--research { background: var(--accent); color: var(--white); }
.news-category-badge--academic { background: var(--primary); color: var(--white); }
.news-category-badge--partnership { background: #2d5f3f; color: var(--white); }
.news-category-badge--event { background: #8b4513; color: var(--white); }

.news-archive-featured__content {
  padding: 2rem 2.25rem 2.25rem;
}

.news-archive-featured__content time {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--secondary-dark);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.news-archive-featured__content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 1rem;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.news-archive-featured__content h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-archive-featured__content h2 a:hover {
  color: var(--secondary-dark);
}

.news-archive-featured__content p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--gray);
  margin: 0 0 1.5rem;
}

.news-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  padding-top: 1rem;
  border-top: 1px solid rgba(10, 37, 64, 0.08);
  transition: all 0.3s ease;
}

.news-read-more svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.news-read-more:hover {
  color: var(--secondary-dark);
}

.news-read-more:hover svg {
  transform: translateX(4px);
}

/* ---- Grid de Notícias ---- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.news-grid-item {
  background: var(--white);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(10, 37, 64, 0.06);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.news-grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(10, 37, 64, 0.1);
  border-color: rgba(201, 169, 97, 0.2);
}

.news-grid-item__media {
  position: relative;
  margin: 0;
  height: 200px;
  overflow: hidden;
}

.news-grid-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.news-grid-item:hover .news-grid-item__media img {
  transform: scale(1.06);
}

.news-grid-item__content {
  padding: 1.5rem;
}

.news-grid-item__content time {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--secondary-dark);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.news-grid-item__content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 0.6rem;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

.news-grid-item__content h3 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-grid-item__content h3 a:hover {
  color: var(--secondary-dark);
}

.news-grid-item__content p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--gray);
  margin: 0;
}

/* ---- Paginação ---- */
.news-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
}

.news-pagination__btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(10, 37, 64, 0.1);
  background: var(--white);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.news-pagination__btn:hover:not(:disabled) {
  border-color: var(--secondary);
  color: var(--secondary-dark);
}

.news-pagination__btn.is-active {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--primary);
  font-weight: 700;
}

.news-pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.news-pagination__dots {
  color: var(--gray);
  padding: 0 0.5rem;
}

.news-pagination__btn svg {
  width: 16px;
  height: 16px;
}

/* ---- Sidebar ---- */
.news-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 100px;
}

.sidebar-block {
  background: var(--white);
  border-radius: 14px;
  padding: 1.75rem;
  border: 1px solid rgba(10, 37, 64, 0.06);
  box-shadow: 0 4px 20px rgba(10, 37, 64, 0.04);
}

.sidebar-block h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(10, 37, 64, 0.08);
  position: relative;
}

.sidebar-block h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 32px;
  height: 2px;
  background: var(--secondary);
}

/* Categorias */
.sidebar-categories {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-categories a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: var(--dark);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.sidebar-categories a:hover {
  background: var(--light);
  color: var(--secondary-dark);
  padding-left: 1.25rem;
}

.sidebar-categories .count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray);
  background: var(--light);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

/* Mais Lidas */
.sidebar-popular {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-popular li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.popular-rank {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--light);
  color: var(--secondary-dark);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
}

.sidebar-popular li div {
  flex: 1;
  min-width: 0;
}

.sidebar-popular a {
  display: block;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.3rem;
  transition: color 0.2s ease;
}

.sidebar-popular a:hover {
  color: var(--secondary-dark);
}

.sidebar-popular time {
  font-size: 0.72rem;
  color: var(--gray);
  letter-spacing: 0.5px;
}

/* Newsletter */
.sidebar-block--newsletter {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--white);
  border: none;
}

.sidebar-block--newsletter h3 {
  color: var(--white);
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

.sidebar-block--newsletter h3::after {
  background: var(--secondary);
}

.sidebar-block--newsletter p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 1.25rem;
}

.sidebar-newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-newsletter-form input {
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  transition: all 0.3s ease;
}

.sidebar-newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.sidebar-newsletter-form input:focus {
  border-color: var(--secondary);
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-newsletter-form button {
  padding: 0.85rem;
  background: var(--secondary);
  color: var(--primary);
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s ease;
  font-family: inherit;
}

.sidebar-newsletter-form button:hover {
  background: var(--secondary-dark);
}

/* =========================================================
   RESPONSIVIDADE — NOTÍCIAS
   ========================================================= */
@media (max-width: 1100px) {
  .news-archive__layout {
    grid-template-columns: 1fr;
  }
  .news-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .news-hero {
    padding: 3.5rem 0 3rem;
  }
  .news-archive {
    padding: 2.5rem 0 3.5rem;
  }
  .news-archive__toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .news-archive__filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
  }
  .news-filter {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-archive-featured__media {
    height: 240px;
  }
  .news-archive-featured__content {
    padding: 1.5rem;
  }
  .news-archive-featured__content h2 {
    font-size: 1.35rem;
  }
  .news-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .news-archive-featured__content h2 {
    font-size: 1.2rem;
  }
  .news-grid-item__media {
    height: 180px;
  }
}


/* =========================================================
   PAGE LOADER (Ecrã de Carregamento)
   ========================================================= */

.page-loader {
    position: fixed;
    inset: 0;
    /* Fundo semitransparente */
    background: rgba(3, 35, 64, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Logo/imagem de carregamento */
.page-loader::before {
    content: "";
    width: 100px;
    height: 100px;
    background-image: url("../img/ucc1.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 20px;
    border-radius: 50%;
}

/* Estado quando a página termina de carregar */
.page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Círculo de processamento */
.loader-spinner {
    width: 38px;
    height: 38px;

    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--secondary, #c9a961);
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}

@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}
